import express from 'express'
import loggerMiddleware from './middleware/logger.js'

const app = express()

app.use(loggerMiddleware)

app.use('*', (req, res, next) => {
	res.setHeader('Access-Control-Allow-Origin', 'http://127.0.0.1:5605')
	next()
})

app.get('/info', function (req, res) {
	res.json({
		code: 200,
		type: 'get',
	})
})

app.listen(8000, () => {
	console.log('http://localhost:8000')
})
